﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LittleBoxes
{
    /// <summary>
    /// A Node in a directed graph.
    /// </summary>
    public partial class Node : UserControl
    {
        /// <summary>
        /// Creates a new Node.
        /// </summary>
        public Node()
        {
            InitializeComponent();
            this.inputAreaConnectionPointPanel.Style = ConnectionPointPanelStyle.Input;
            this.outputAreaConnectionPointPanel.Style = ConnectionPointPanelStyle.Output;
        }

        /// <summary>
        /// Gets or Sets the Node's title text
        /// </summary>
        public string Title
        {
            get { return titleLabel.Text;  }
            set { titleLabel.Text = value; }
        }

        /// <summary>
        /// Gets or sets the number of inputs to this Node.  
        /// WARNING: setting this will clear any previously-defined inputs!
        /// </summary>
        public int InputCount
        {
            get { return this.inputAreaConnectionPointPanel.Count; }

            set { this.inputAreaConnectionPointPanel.Count = value; }
        }

        /// <summary>
        /// Gets or sets the number of outputs to the Node.
        /// WARNING: setting this will clear any previously-defined outputs!
        /// </summary>
        public int OutputCount
        {
            get { return this.outputAreaConnectionPointPanel.Count; }

            set { this.outputAreaConnectionPointPanel.Count = value; }
        }
    }
}
